package org.jsbd.boss.dao.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.jsbd.boss.common.DataGridModel;
import org.jsbd.boss.dao.IMiguVideoDaylimitDAO;
import org.jsbd.boss.domian.MiguMusicDaylimitBean;
import org.jsbd.boss.domian.MiguMusicDaylimitVO;
import org.jsbd.boss.domian.MiguVideoDaylimitBean;
import org.jsbd.boss.domian.MiguVideoDaylimitVO;
import org.springframework.stereotype.Repository;

@Repository("miguVideoDaylimitDAO")
public class MiguVideoDaylimitDAOImpl extends CrackBaseDao implements IMiguVideoDaylimitDAO {

	/**
	 * 获取分页数据
	 */
	@Override
	public Map<String, Object> findDataWithPage(DataGridModel page, MiguVideoDaylimitVO mmdVO) {
		mmdVO = (mmdVO == null ? new MiguVideoDaylimitVO() : mmdVO);
		mmdVO.setPageInfo(page);
	    Map<String, Object> results = new HashMap<String, Object>();
	    results.put("rows", super.queryForList("qy_migu_video_daylimit.SELECT_LIST_WITH_CONDITION", mmdVO));
	    results.put("total", super.queryForCount("qy_migu_video_daylimit.SELECT_COUNT_WITH_CONDITION", mmdVO));
	    return results;
	}

	/**
	 * 新增
	 */
	@Override
	public void insert(MiguVideoDaylimitBean mmdBean) {
		super.insert("qy_migu_video_daylimit.INSERT_DAYLIMIT", mmdBean);
	}

	/**
	 * 查询单个实例
	 */
	@Override
	public MiguVideoDaylimitBean selectOne(Integer id) {
		return (MiguVideoDaylimitBean) super.queryForObject("qy_migu_video_daylimit.SELECT_ONE", id);
	}

	/**
	 * 更新
	 */
	@Override
	public void updateDAO(MiguVideoDaylimitBean mmdBean) {
		super.update("qy_migu_video_daylimit.UPDATE_DAYLIMIT", mmdBean);
	}

	/**
	 * 删除
	 */
	@Override
	public void delete(Integer id) {
		super.update("qy_migu_video_daylimit.DELETE_DAYLIMIT", id);
	}

	/**
	 * 获取增量数据
	 */
	@Override
	public List<MiguVideoDaylimitBean> selectDeltaData(Integer offset) {
		return super.queryForList("qy_migu_video_daylimit.SELECT_DELTA_DATA", offset);
	}
	
	/**
	 * 修改执行状态
	 */
	@Override
	public void updateIsExecute(List<MiguVideoDaylimitBean> mmdBeans) {
		super.batchUpdate("qy_migu_video_daylimit.UPDATE_IS_EXECUTE", mmdBeans);
	}

	@Override
	public MiguVideoDaylimitBean getByMark(String mark) {
		return (MiguVideoDaylimitBean) super.queryForObject("qy_migu_video_daylimit.SELECT_BY_MARK", mark);
	}

}
